package sipus.action.maintenance;

import javax.servlet.http.HttpServletRequest;

import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.util.GenericAutowireComposer;

public class BlankAction extends GenericAutowireComposer {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1783885254736882086L;

//	private Image utama_image;

	@Override
	public void doAfterCompose(Component comp) throws Exception {
		super.doAfterCompose(comp);

		HttpServletRequest request = (HttpServletRequest) execution
				.getNativeRequest();
		String req = request.getRequestURL().toString();
		req = req.replaceAll("http://", "");
		req = req.split(":")[0];
		req = req.split("/")[0];
		System.out.println("URL = " + req);
//		String content_path = request.getContextPath().replace("/", "");
//		File file = new File(application.getRealPath("/img/" + req + ".png"));
//		if (content_path.contains("contoh")) {
//			file = new File(Sessions.getCurrent().getWebApp()
//					.getRealPath("/img/contoh.png"));
//		}
//		if (file.exists() && utama_image != null) {
//			System.out.println(file.getAbsolutePath());
//			AImage aImage = new AImage(file);
//			utama_image.setWidth("100%");
//			utama_image.setHeight("100%");
//			utama_image.setContent(aImage);
//			return;
//		}

	}

}
